//
//  NSDictionary+Extensions.h
//  Dictionary
//
//  Created by chenyibo on 15/12/28.
//  Copyright © 2015年 chenyibo. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface NSDictionary (Extensions)

+ (NSDictionary *)safetyDictionaryWithKeysAndObjects:(id)firstObject, ...NS_REQUIRES_NIL_TERMINATION;

@end

@interface NSMutableDictionary (Extensions)

+ (NSMutableDictionary *)safetyDictionaryWithKeysAndObjects:(id)firstObject, ... NS_REQUIRES_NIL_TERMINATION;

/// 插入通用对象，包括字符串、数字型对象、数组、字典或其他对象
/// object、key和value都会做非空校验
/// @param value 如果object为nil，且value非空，则会将value作为默认值插入
- (void)setObject:(id)object forKey:(id<NSCopying>)key defaultValue:(id)value;

@end
